//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mapper;

import com.example.entity.Employee;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface EmployeeMapper {
    List<Employee> selectAll(Employee employee);

    @Select({"select * from employee where id = #{id}"})
    Employee selectById(Integer id);

    @Insert({"insert into employee (username,password,role,name,sex,no,age,descr,department_id,avatar) values (#{username},#{password},#{role},#{name},#{sex},#{no},#{age},#{descr},#{departmentId},#{avatar})"})
    int insert(Employee employee);//后端_，前端驼峰

    @Update({"update employee set username = #{username}, password= #{password}, role= #{role},name = #{name}, sex = #{sex},no = #{no},age = #{age},descr = #{descr},department_id = #{departmentId},avatar = #{avatar} where id=#{id}"})
    int updateById(Employee employee);

    @Delete({"delete from employee where id = #{id}"})
    int deleteById(Integer id);

    @Select({"select * from employee where username = #{username}"})
    Employee selectByUsername(String username);

    @Select({"select * from employee where no = #{no}"})
    Employee selectByNo(String no);
}
